package com.tvb.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;

@Entity
@Table(name="login_purview")
public class LoginPurview {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@Column(name="purview_name")
	private String purviewName;//地址名称
	
	@Column(name="memo")
	private String memo;//描述
	
	@Column(name="path")
	private String path;//地址
	
	@Column(name="op_date")
	private Date opDate;//创建时间
	
	@ManyToMany(mappedBy="loginPurviews")
	private Set<LoginRole> roleCodes = new HashSet<LoginRole>(); 
	
	public Set<LoginRole> getRoleCodes() {
		return roleCodes;
	}

	public void setRoleCodes(Set<LoginRole> roleCodes) {
		this.roleCodes = roleCodes;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}



	public String getPurviewName() {
		return purviewName;
	}


	public void setPurviewName(String purviewName) {
		this.purviewName = purviewName;
	}


	public String getMemo() {
		return memo;
	}



	public void setMemo(String memo) {
		this.memo = memo;
	}



	public String getPath() {
		return path;
	}



	public void setPath(String path) {
		this.path = path;
	}



	public Date getOpDate() {
		return opDate;
	}



	public void setOpDate(Date opDate) {
		this.opDate = opDate;
	}



	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
